package com.jsoft.jsofted.framework.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.diboot.core.binding.annotation.BindField;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.jsoft.jsofted.sys.entity.UserEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 有人员归属的实体类：即数据归属于某个特定的人员。
 */
@Data
@EqualsAndHashCode(callSuper = false)
public abstract class OfUserEntity extends OfOrgEntity {

    @Column
    protected Long userId;

    /**
     * 用户姓名：自动获取登录用户的真实姓名，关联 UserEntity.name
     */
    @TableField(exist = false)
    @BindField(entity = UserEntity.class, field = "name", condition = "user_id=id")
    protected String userName;
}
